﻿using System.Net;
using System.Runtime.Serialization;

namespace Toybox.NicoSharp.Video.RiApi
{
	using RiApiPrimitives;

	public class MylistVideo : AbstractRiApi
	{

		#region [Static]

		public static MylistVideo Get(string id, CookieCollection cookies = null)
		{
			if (string.IsNullOrEmpty(id)) return null;

			string url = NicoUrls.RiApi + "watch/mylistvideo";
			return Get<MylistVideo>(url + "?id=" + id, cookies);
		}

		#endregion [Static]


		#region Public Members

		[DataMember]
		public string name;

		[DataMember]
		public string description;

		[DataMember]
		public string user_id;

		[DataMember]
		public string user_nickname;

		[DataMember]
		public string default_sort;

		[DataMember]
		public bool is_watching_this_mylist;

		[DataMember]
		public bool is_watching_count_full;

		[DataMember]
		public Item[] list;

		#endregion Public Members


		#region [SubClass]

		[DataContract]
		public class Item
		{
			[DataMember]
			public string id;

			[DataMember]
			public string thumbnail_url;

			[DataMember]
			public string length;

			[DataMember]
			public string length_seconds;

			[DataMember]
			public string title;

			[DataMember]
			public int view_counter;

			[DataMember]
			public int num_res;

			[DataMember]
			public int mylist_counter;

			[DataMember]
			public string first_retrieve;

			[DataMember]
			public string description_short;

			[DataMember]
			public int create_time;

			[DataMember]
			public string thread_update_time;

			[DataMember]
			public string mylist_comment;
		}

		#endregion [SubClass]

	}
}
